package haiyangwangwork.day02.homework;

public class RightTriangle extends Triangle{
    double hypottenuse;

    public RightTriangle(int base, int height) {
        super(base, height);
        this.hypottenuse=Math.sqrt(base*base+height*height);
        System.out.println("RightTriangle类的构造器中");
    }

    @Override
    public String toString() {
        return "高为"+this.height+"底为"+this.base+"斜边长为:"+this.hypottenuse;

    }


}
